package com.ym.medical.enums;

import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.util.StdConverter;
import com.ym.common.annotations.EnumDescription;
import com.ym.common.constant.DictEnum;

/**
 * 实名认证图片类型
 */
@EnumDescription("实名认证图片类型")
public enum CertificateEnum implements DictEnum {

    //--------------------start-----------------

    /**
     * 身份证
     */
    ID_CARD("01","身份证"),
    /**
     * 医师执业证
     */
    PRACTICE("02","医师执业证"),
    /**
     * 医师资格证书
     */
    CERTIFIACATION("03","医师资格证书"),
    /**
     * 专业技术资格证
     */
    PROFESSIONAL_SKILL("04","专业技术资格证"),

    //--------------------end-------------------
    ;
    private String key;

    private String value;

    CertificateEnum(String key, String value) {
        this.key = key;
        this.value = value;
    }

    @Override
    public String getKey() {
        return this.key;
    }

    @Override
    public String getValue() {
        return this.value;
    }

    /**
     * 序列化使用
     */
    public static class Covert extends StdConverter<String, JSONObject> {
        @Override
        public JSONObject convert(String value) {
            return DictEnum.valueOfJson(CertificateEnum.class, value);
        }
    }
}
